package com.brkj.util.view;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TextView;
import com.brkj.main.R;

/**
 * Created by colin.ding on 2014/5/7.
 */
public abstract class BaseListView{

    protected View root;
    protected Context mContext;
    protected ListView listView;
    protected TextView noContent;
    protected Boolean hasShown =false;

    public BaseListView(Context context){
        mContext = context;
    }


    public View getView(){
        root =  LayoutInflater.from(mContext).inflate(R.layout.list_fragment, null);

        listView = (ListView)root.findViewById(R.id.listView);
        noContent = (TextView)root.findViewById(R.id.noContent);

        return root;
    }

    public void show(){
        if(hasShown){
            return;
        }else{
            fillView();
            hasShown = true;
        }

    }

    protected abstract void fillView();

}